home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qdialog.h.z / qdialog.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  2.0 KB  |  80 lines

  1. /****************************************************************************
  2. ** $Id: qdialog.h,v 2.7 1998/07/03 00:09:32 hanord Exp $
  3. **
  4. ** Definition of QDialog class
  5. **
  6. ** Created : 950502
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QDIALOG_H
  25. #define QDIALOG_H
  26.  
  27. #ifndef QT_H
  28. #include "qwidget.h"
  29. #endif // QT_H
  30.  
  31.  
  32. class QPushButton;
  33.  
  34.  
  35. class QDialog : public QWidget            // dialog widget
  36. {
  37. friend class QPushButton;
  38.     Q_OBJECT
  39. public:
  40.     QDialog( QWidget *parent=0, const char *name=0, bool modal=FALSE,
  41.          WFlags f=0 );
  42.    ~QDialog();
  43.  
  44.     enum DialogCode { Rejected, Accepted };
  45.  
  46.     int        exec();
  47.     int        result()  const { return rescode; }
  48.  
  49.     void    show();
  50.     void    move( int x, int y );
  51.     void    move( const QPoint &p );
  52.     void    resize( int w, int h );
  53.     void    resize( const QSize & );
  54.     void    setGeometry( int x, int y, int w, int h );
  55.     void    setGeometry( const QRect & );
  56.  
  57. protected slots:
  58.     virtual void done( int );
  59.     void    accept();
  60.     void    reject();
  61.  
  62. protected:
  63.     void    setResult( int r )    { rescode = r; }
  64.     void    keyPressEvent( QKeyEvent * );
  65.     void    closeEvent( QCloseEvent * );
  66.  
  67. private:
  68.     void    setDefault( QPushButton * );
  69.     int        rescode;
  70.     uint    did_move   : 1;
  71.     uint    did_resize : 1;
  72.  
  73. private:    // Disabled copy constructor and operator=
  74.     QDialog( const QDialog & );
  75.     QDialog &operator=( const QDialog & );
  76. };
  77.  
  78.  
  79. #endif // QDIALOG_H
  80.